var ui = document.querySelector('div>input:nth-of-type(1)');
var un = document.querySelector('div>label:nth-of-type(2)');
var u = document.getElementsByClassName('qq');
console.log(un)
ui.onchange = function () {
    for (var i = 0; i < u.length; i++) {
        u[i].checked = this.checked;
    }
}
un.onclick = function () {
    for (var i = 0; i < u.length; i++) {
        u[i].checked = !u[i].checked;
    }
}